home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / OpenLinux 2.3 CD.iso / live / usr / include / libst.h next >
Encoding:
C/C++ Source or Header  |  1999-08-10  |  1.5 KB  |  42 lines

  1. /* libst.h - include file for portable sound tools library
  2. **
  3. ** Copyright (C) 1989 by Jef Poskanzer.
  4. **
  5. ** Permission to use, copy, modify, and distribute this software and its
  6. ** documentation for any purpose and without fee is hereby granted, provided
  7. ** that the above copyright notice appear in all copies and that both that
  8. ** copyright notice and this permission notice appear in supporting
  9. ** documentation.  This software is provided "as is" without express or
  10. ** implied warranty.
  11. */
  12.  
  13. #define MINLIN -32768
  14. #define MAXLIN 32767
  15. #define LINCLIP(x) do { if ( x < MINLIN ) x = MINLIN ; else if ( x > MAXLIN ) x = MAXLIN; } while ( 0 )
  16.  
  17. /* These do not round data.  Caller must round appropriately. */
  18.  
  19. #ifdef FAST_ULAW_CONVERSION
  20. extern int ulaw_exp_table[256];
  21. extern unsigned char ulaw_comp_table[16384];
  22. #define st_ulaw_to_linear(ulawbyte) ulaw_exp_table[ulawbyte]
  23. #define st_linear_to_ulaw(linearword) ulaw_comp_table[(linearword / 4) & 0x3fff]
  24. #else
  25. unsigned char st_linear_to_ulaw( /* int sample */ );
  26. int st_ulaw_to_linear( /* unsigned char ulawbyte */ );
  27. #endif
  28.  
  29. #ifdef FAST_ALAW_CONVERSION
  30. extern int Alaw_exp_table[256];
  31. extern unsigned char Alaw_comp_table[16384];
  32. #define st_Alaw_to_linear(Alawbyte) Alaw_exp_table[Alawbyte]
  33. #define st_linear_to_Alaw(linearword) Alaw_comp_table[(linearword / 4) & 0x3fff]
  34. #else
  35. unsigned char st_linear_to_Alaw( /* int sample */ );
  36. int st_Alaw_to_linear( /* unsigned char ulawbyte */ );
  37. #endif
  38.  
  39. #ifdef    USG
  40. #define    setbuffer(x,y,z)
  41. #endif
  42.